//GA config
//$Id: ga_config.h 199 2009-09-17 11:00:31Z Oleg.Bulychov $
#pragma once
#ifndef GA_CONFIG_H
#define GA_CONFIG_H

#include "src/heo/include/selection.h"
//__________________________________________________________________________________
//__________________________________________________________________________________
struct GA_Config
{
    int         population_size_;
    int         offspring_size_;
    int         parent_selection_;
    int         offspring_selection_;
    int         tournament_size_;
    double      crossover_probability_;
    double      mutation_probability_;
    bool        mutation_fadeout_;
    bool        only_offspring_;

    bool        async_mode_;
    int         migration_size_;
    int         migration_rate_;

    template<class V>
    void accept(V& v)
    {
        v(VAR_(population_size),            meta::validator(30, 1, std::numeric_limits<int>::max()));
        v(VAR_(offspring_size),             meta::validator(50, 1, std::numeric_limits<int>::max()));
        v(VAR_(only_offspring),             false);
        v(VAR_(parent_selection),           (int)SELECTION_ROULETTE);
        v(VAR_(offspring_selection),        (int)SELECTION_TOURNAMENT);
        v(VAR_(tournament_size),            4);
        v(VAR_(crossover_probability),      0.3);
        v(VAR_(mutation_probability),       0.003);
        v(VAR_(mutation_fadeout),           false);

        v(VAR_(async_mode),                 true);
        v(VAR_(migration_size),             3);
        v(VAR_(migration_rate),             25);
    }
};
//__________________________________________________________________________________
//__________________________________________________________________________________

#endif
//EOF!
